package Com.Hupochuan.Vo;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

import Com.Hupochuan.Uil.Util.TimeStringUtil;

/*
 * 电影表 Movie
 */
public class Movie {		
	//					字段名			字段类型			中文解析		缺省(Default)	备注
	private Long 		id;//			INT				ID			AUTO_INCREMENT	PRIMARY KEY
	private String 		name;//			VARCHAR(50)		片名			(空字符串)		UNIQUE KEY
	private String 		byname;//		VARCHAR(50)		别名			(空字符串)	
	private String 		logoPath;//		VARCHAR(50)		海报图片路径	(空字符串)	
	private Long 		directorId;//	INT				导演ID		0	
	private Long 		areaId;//		INT				地区ID		0	
	private Date 		releaseDate;//	DATE			上映日期		NULL
	private String 		baikeUrl;//		VARCHAR(200)	百科网址		(空字符串)	
	private String 		summary;//		VARCHAR(20000)	剧情简介		(空字符串)	
	private Float 		weight;//		FLOAT			权重			0	
	private Timestamp 	createTime;//	DATETIME		创建时间		No default	
	private Timestamp 	updateTime;//	DATETIME		更新时间		No default	
	
	private String 				directorName;//		导演名
	private String				areaName;//			地区名
	private Long 				typeCount;//		类型数量
	private Long 				actorCount;//		演员数量
	private Long 				sourceCount;//		资源数量
	private List<MovieActor> 	movieActorList;//	电影演员列表
	private List<MovieType>		movieTypeList;//	电影类型列表
	private List<MovieSource> 	movieSourceList;//	电影资源列表
	private String 				tempImgName="";//	临时图片名 用于存储数据时使用
	
	/*
	 * 获得转换的时间字符串
	 */
	public String getCreateTimeString() {
		return TimeStringUtil.getObject().timeToTimeString(this.createTime);
	}
	public String getUpdateTimeString() {
		return TimeStringUtil.getObject().timeToTimeString(this.updateTime);
	}
	
	/*
	 * 获得编码的名称
	 */
	public String getEncodeName(){
		String encodeName = "";
		try {
			encodeName =  URLEncoder.encode(this.name,"utf-8");
		} 
		catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return encodeName;
	}
	
	/*
	 * 参数注入
	 */
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getByname() {
		return byname;
	}
	public void setByname(String byname) {
		this.byname = byname;
	}
	public String getLogoPath() {
		return logoPath;
	}
	public void setLogoPath(String logoPath) {
		this.logoPath = logoPath;
	}
	public Long getDirectorId() {
		return directorId;
	}
	public void setDirectorId(Long directorId) {
		this.directorId = directorId;
	}
	public Long getAreaId() {
		return areaId;
	}
	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	public Date getReleaseDate() {
		return releaseDate;
	}
	public void setReleaseDate(Date releaseDate) {
		this.releaseDate = releaseDate;
	}
	public Float getWeight() {
		return weight;
	}
	public void setWeight(Float weight) {
		this.weight = weight;
	}
	public String getBaikeUrl() {
		return baikeUrl;
	}
	public void setBaikeUrl(String baikeUrl) {
		this.baikeUrl = baikeUrl;
	}
	public List<MovieActor> getMovieActorList() {
		return movieActorList;
	}
	public void setMovieActorList(List<MovieActor> movieActorList) {
		this.movieActorList = movieActorList;
	}
	public List<MovieType> getMovieTypeList() {
		return movieTypeList;
	}
	public void setMovieTypeList(List<MovieType> movieTypeList) {
		this.movieTypeList = movieTypeList;
	}
	public Long getActorCount() {
		return actorCount;
	}
	public void setActorCount(Long actorCount) {
		this.actorCount = actorCount;
	}
	public Long getSourceCount() {
		return sourceCount;
	}
	public void setSourceCount(Long sourceCount) {
		this.sourceCount = sourceCount;
	}
	public String getDirectorName() {
		return directorName;
	}
	public void setDirectorName(String directorName) {
		this.directorName = directorName;
	}
	public String getAreaName() {
		return areaName;
	}
	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	public Long getTypeCount() {
		return typeCount;
	}
	public void setTypeCount(Long typeCount) {
		this.typeCount = typeCount;
	}
	public String getTempImgName() {
		return tempImgName;
	}
	public void setTempImgName(String tempImgName) {
		this.tempImgName = tempImgName;
	}
	public List<MovieSource> getMovieSourceList() {
		return movieSourceList;
	}
	public void setMovieSourceList(List<MovieSource> movieSourceList) {
		this.movieSourceList = movieSourceList;
	}
}
